<template>
  <div>
    <div>
      <h3>a组件：{{ age }}</h3>
      <button @click="sendData">将数组发送给b组件</button>
    </div>
  </div>
</template>
  
    <script>
import bus from "../../views/utils/bus";
export default {
  data() {
    return {
      age: 20,
    };
  },

  methods: {
    sendData() {
      bus.$emit("sendAge", this.age);
    },
  },
};
</script>
    
    <style>
</style>